package filter;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebFilter;

@WebFilter(filterName="ABCFilter",urlPatterns= {"/ABCFilter","*.do","/test/*"})

public class ABCFilter implements Filter {
	public ABCFilter() {
		System.out.println("执行ABCFilter的构造方法");
	}
	public void destroy() {
		System.out.println("执行ABCFilter的destroy方法");
	}
	public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
			throws IOException, ServletException {
		System.out.println("执行ABCFilter的doFilter之前的代码");
		chain.doFilter(request, response);
		System.out.println("执行ABCFilter的doFilter之后的代码");
	}
	public void init(FilterConfig fConfig) throws ServletException {
		System.out.println("执行ABCFilter的init方法");
	}
}